package com.controller;

import com.service.ManagerService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.jws.Oneway;
import java.util.List;
import java.util.Map;

@RestController
@RequestMapping("Manager")
public class MySsmController {
    @Autowired(required = false)
    ManagerService managerService;
    @RequestMapping("findOne")
    public Map<String ,Object> findOne(int id){
        return managerService.findOne(id);
    }
    @RequestMapping("findAll")
    public List<Map<String, Object>> findAll(){
        return managerService.findAll();
    }
    @RequestMapping("addOne")
    public Integer addOne(@RequestBody Map<String,Object> map ){
        return managerService.addOne(map);
    }
    @RequestMapping("deleteOne")
    public Integer deleteOne(int id){
        return managerService.deleteOne(id);

    }
    @RequestMapping("updateOne")
    public Integer updateOne(@RequestBody Map<String, Object>map){
        return managerService.updateOne(map);
    }
}
